package com.itheima.mapper;

import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

public interface MemberDao {

    /**
     * 添加会员
     * @param member
     */
    void addMember(Member member);

    /**
     * 根据手机号查询会员
     * @param telephone
     * @return
     */
    Member findByTelephone(String telephone);

    /**
     * 根据条件查询会员
     * @param member
     * @return
     */
    Member getCondition(Member member);

    /**
     * 查询所有会员列表
     * @return
     */
    @Select("select * from t_member")
    List<Member> getMemberList();

    /**
     * 根据日期查询会员数量
     * @param lastDayOfMonth
     * @return
     */
    Integer getMemberCountByDate(LocalDate lastDayOfMonth);

    /**
     * 根据日期范围查询会员数量
     * @param begin
     * @param end
     * @return
     */
    Integer getCountByDate(LocalDate begin, LocalDate end);
}
